/*
 *    Thing Game Library
 *   Copyright (C)2005 - 2010 Eduardo Nunes Pereira (eduardonunesp at gmail dot com)
 *
 *   This program/library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 *   This program/library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 *    You should have received a copy of the GNU Lesser General Public
 * License along with this program/library ; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#ifndef __MOUSE_HPP__
#define __MOUSE_HPP__

#include <SDL/SDL.h>
#include <map>
#include <string>
#include "Vector.hpp"

namespace Thing
{
    namespace Events
    {
        class Mouse
        {
        public:
            struct Button
            {
                typedef enum
                {
                    __FIRST__     = 0,
                    LEFT_BUTTON   = SDL_BUTTON_LEFT,
                    MIDDLE_BUTTON = SDL_BUTTON_MIDDLE, 
                    RIGHT_BUTTON  = SDL_BUTTON_RIGHT,
                    WHEEL_UP      = SDL_BUTTON_WHEELUP,
                    WHEEL_DOWN    = SDL_BUTTON_WHEELDOWN,
                    __LAST__      

                } Buttons;


                struct ButtonState
                {
                    typedef enum
                    {
                        RELEASED = SDL_RELEASED,
                        PRESSED  = SDL_PRESSED,
                        CLEARED
                    } States;
                };

                static std::string buttonToString(int b);
                static std::string buttonStatetoString(int state);
            };

            typedef std::map<int, int> ButtonMap;

            Mouse() {}
            ~Mouse() {}

            void showCursor(bool show); 
            void setMousePos(unsigned short int x, unsigned short int y);
            void setButtonState(int state, int b);
            bool checkKeyState(int b);
    
        private:
            Geometry::Vector _pos;
            ButtonMap        _button;
        };
    }
}

#endif /* __MOUSE_HPP__ */


